package com.ad_hccm.dao.TreatmentHistory;

import com.ad_hccm.domain.TreatmentHistory.TreatmentHistory;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * TODO 治疗史Dao
 */
@Mapper
public interface TreatmentHistoryDao {
    @Insert("insert into treatment_history value(#{id}, #{isSystemMedicine}, #{isOralMedicine}, #{isTopicalMedicine}, #{isPhysical}, #{physical}, #{isOtherDiseaseOne}, #{isOtherDiseaseTwo})")
    public boolean save(TreatmentHistory treatmentHistory);

    @Update("update treatment_history set isSystemMedicine = #{isSystemMedicine}, isOralMedicine = #{isOralMedicine}, isTopicalMedicine = #{isTopicalMedicine}, isPhysical = #{isPhysical}, physical = #{physical}, isOtherDiseaseOne = #{isOtherDiseaseOne}, isOtherDiseaseTwo = #{isOtherDiseaseTwo} where id=#{id}")
    public boolean update(TreatmentHistory treatmentHistory);

    @Select("select * from treatment_history where id=#{id}")
    public TreatmentHistory getById(String id);

    @Select("select * from treatment_history")
    public List<TreatmentHistory> getAll();

}